package api;

import api.connection.DBConnection;
import api.result.Result;

/***
 * 包含于Terminal内，用于执行一个测试单元
 */
public abstract class Worker {
    protected Configuration config;

    public Worker(Configuration config) {
        this.config = config;
    }

    public void setConfig(Configuration config) {
        this.config = config;
    }

    public Configuration getConfig() {
        return config;
    }

    /***
     * 给定测试单元，通过Connection执行一个测试单元，如Q1
     * @param connection 实例化的connection或client
     * @param nextProcedure 测试单元的名字
     * @return
     */
    public abstract Result executeProcedure(DBConnection connection, String nextProcedure);
}
